home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-02-08 | 921 b | 35 lines | [TEXT/KEEN] |
- #$Renumber_PICTs:
- # run on a specific derezzed resource description file containing PICT's,
- # to change the PICT numbers.
- # MODIFY the formula for "num" below to suit your current needs.
- # Set 'outfile' variable to the output file name (eg test.r) with Set Variables.
-
- # to be renumbered.
-
-
- BEGIN {
- z = split(ARGV[1], names, ":");#fragment the full path into the array “names”
- for (i = z-1; i >= 1; --i) #note i = z gives the input file name proper
- outfile = names[i] ":" outfile;#put path in front of outfile name
- progressFile = STDPATH "$tempProgress"
- }
-
- /resource 'PICT' \(/ {
- match($0, /[0-9]+/);
- num = substr($0,RSTART, RLENGTH)
- #1000->2000,1001->2100 etc
- num = int(2000 + (num-1000)*100)
- sub(/[0-9]+/, num)
- print $0 > outfile
- if (!progress(++q "done..."))
- { # concurrent mode, print progress to file
- print q, "done..." > progressFile
- close(progressFile)
- }
- next
- }
-
- {
- print $0 > outfile
- }
-